#include <stdio.h>
#include <stdlib.h>

#define BUFSIZE 256
	int main(int argc,char **argv)
{
	FILE *fps;
	char buff[BUFSIZE] = {0};
	
	if(argc < 2)
	{
		fprintf(stderr,"uage:%s\n",argv[0]);
		exit(1);
	}

	fps = fopen(argv[1],"ab+");
	if(fps == NULL)
	{
		perror("fopen()");
		exit(1);
	}


	int year = 2000,month = 9,day = 3;
	fprintf(fps,"%d-%d-%d",year,month,day);	
	snprintf(buff,BUFSIZE,"%d-%d-%d",year,month,day);	
	fputs(buff,stdout);
	fclose(fps);

	exit(0);
}

